﻿@model IEnumerable<MvcMercadoLibre.Models.Articulo>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
        </th>
        <th>
            Nombre
        </th>
        <th>
            Precio
        </th>
        <th>
            Cantidad
        </th>
        <th>
            UrlImagen
        </th>
    </tr>
    @if (Model != null && Model.Count() != 0)
    {
        foreach (var item in Model)
        {
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id })
            </td>
            <td>
                @item.Nombre
            </td>
            <td>
                @String.Format("{0:F}", item.Precio)
            </td>
            <td>
                @item.Cantidad
            </td>
            <td>
                @Html.Image("../../Content/Images/Products", item.UrlImagen)
            </td>
        </tr>
        }
    }
    else
    { 
        <tr>
            <td colspan="5" align="center">
                NO HAY REGISTROS
            </td>
        </tr>
    }
</table>
